package com.tiny.myagent.enums;

import java.util.Arrays;

public enum BootAction {

    REBOOT("reboot", "重启"),
    SHUT_DOWN("shutdown", "关机");

    BootAction(String action, String remark) {
        this.action = action;
        this.remark = remark;
    }

    private String action;

    private String remark;

    public String getAction() {
        return action;
    }

    public String getRemark() {
        return remark;
    }

    public static BootAction getReboot(String action) {
        return Arrays.stream(values())
                .filter(item -> item.action.equals(action))
                .findFirst()
                .orElse(null);
    }
}
